package com.crx.springbootinit.service;

import com.crx.springbootinit.model.dto.page.PageVO;
import com.crx.springbootinit.model.dto.user.UserEnableDTO;
import com.crx.springbootinit.model.dto.user.UserPageDTO;
import com.crx.springbootinit.model.dto.user.UserUpdateMyRequest;
import com.crx.springbootinit.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.crx.springbootinit.model.vo.post.PostHomeVO;
import com.crx.springbootinit.model.vo.user.UserAndPostInfo;
import com.crx.springbootinit.model.vo.user.UserPageVO;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author author
 * @since 2024-10-21
 */
public interface IUserService extends IService<User> {

    User getLoginUser(Long userId);

    /**
     * 分页查询用户
     * @param userPageDTO
     * @return
     */
    PageVO<UserPageVO> queryUserPage(UserPageDTO userPageDTO);

    /**
     * 禁用启用用户
     * @param userEnableDTO
     */
    void enableUser(UserEnableDTO userEnableDTO);

    UserAndPostInfo getUserAndPostInfo(Long userId,int pageNum, int pageSize);

    /**
     * 注册账户
     * @param acount
     * @param password
     */
    void register(String acount, String password);

    PageVO<PostHomeVO> getMyPost(Long userId,int pageNum, int pageSize,int type);

    void editPrivateMessage(UserUpdateMyRequest userUpdateMyRequest);

    /**
     * 统计用户总数
     * @return
     */
    int getTotalUserCount();

    List<HashMap<String, Object>> getUserTrend();

    List<HashMap<String, Object>> getUserAgeGroup();
}
